package com.example.travel.activity;

import android.os.Bundle;
import android.widget.EditText;
import android.widget.ListView;

import androidx.appcompat.app.AppCompatActivity;

import com.example.travel.Adapter.MyAdapter;
import com.example.travel.R;
import com.example.travel.bean.AddDynamic;

import java.io.File;
import java.util.List;

import cn.bmob.v3.Bmob;
import cn.bmob.v3.BmobQuery;
import cn.bmob.v3.datatype.BmobFile;
import cn.bmob.v3.exception.BmobException;
import cn.bmob.v3.listener.FindListener;
import cn.bmob.v3.listener.UploadFileListener;

public class GainActivity extends AppCompatActivity {
    ListView lv1;
    private EditText et1,et2 ;

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Bmob.initialize(this, "725506ecca6f5fd13ccdb5541cddf851");
        setContentView(R.layout.dongtai);
        lv1 = findViewById(R.id.lv1);
//        BmobQuery<AddDynamic> bmobQuery = new BmobQuery<AddDynamic>();
//        bmobQuery.findObjects(new FindListener<AddDynamic>() {
//            @Override
//            public void done(List<AddDynamic> list, BmobException e) {
//               if (e == null){
//                   lv1.setAdapter(new MyAdapter(GainActivity.this , list));
//               }
//            }
//        });
        String Travel = "sdcard/cc.jpg";
        BmobFile bmobFile = new BmobFile(new File(Travel));
        bmobFile.uploadblock(new UploadFileListener() {

            @Override
            public void done(BmobException e) {
                if(e==null){
                    //bmobFile.getFileUrl()--返回的上传文件的完整地址

                }else{

                }

            }

            @Override
            public void onProgress(Integer value) {
                // 返回的上传进度（百分比）
            }
        });


    }
}
